package com.googlecode.survivalcraft;

import com.googlecode.survivalcraft.TileEntityCampFire;

import java.util.logging.Logger;

import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.BlockLeaves;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Item;
import net.minecraft.src.ItemLeaves;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "SurvivalCraft", name = "SurvivalCraft", version = "1.4.5 rev 101")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class SurvivalCraft {
	
	
	@Init
	public void load(FMLInitializationEvent event) {

		BlockCampFire campFireIdle = new BlockCampFire(getUnusedBlockID(), false);
		campFireIdle.setHardness(3.5F).setStepSound(net.minecraft.src.Block.soundStoneFootstep).setBlockName("campFire").setRequiresSelfNotify().setCreativeTab(CreativeTabs.tabDecorations);
		GameRegistry.registerBlock(campFireIdle);
		LanguageRegistry.addName(campFireIdle, "CampFire");
		GameRegistry.addRecipe(new ItemStack(campFireIdle), " s ", "sss", "ddd", 'd', new ItemStack(Block.dirt), 's', new ItemStack(Item.stick));
		
		BlockCampFire campFireActive = new BlockCampFire(getUnusedBlockID(), true);
		campFireActive.setHardness(3.5F).setStepSound(net.minecraft.src.Block.soundStoneFootstep).setLightValue(0.875F).setBlockName("campFire").setRequiresSelfNotify();
		GameRegistry.registerBlock(campFireActive);
		//GameRegistry.registerBlock(new CampFireActive(getUnusedBlockID()));
		
		GameRegistry.registerTileEntity(TileEntityCampFire.class, "TileEntityCampFire");
	
		GlobalModifications.modifyToolEffectiveness();
		
		FlintAxe.addFlintAxeRecipe();
		StringFromWool.addStringFromWoolRecipe();
		
	}
	
	private int getUnusedBlockID() {
		int nextUnusedBlockID = 1;
		while(net.minecraft.src.Block.blocksList[nextUnusedBlockID] != null) 
			nextUnusedBlockID++;
		return nextUnusedBlockID;
	}

}
